home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJLSR200.ZIP / utils / rmtemps.pl < prev    next >
Encoding:
Perl Script  |  1996-01-25  |  395 b   |  28 lines

  1. #!perl
  2. # -*- perl -*-
  3.  
  4. $rm = 0;
  5. if ($ARGV[0] eq "-rm") {
  6.     $rm = 1;
  7.     print "Actually removing files...\n";
  8.     shift;
  9. }
  10.  
  11. open(F, "find . -type f -print |");
  12. while (<F>) {
  13.     $t = 0;
  14.  
  15.     $t = 1 if /~/;
  16.     $t = 1 if /#/;
  17.     $t = 1 if /\/[a-h]{8}$/;
  18.  
  19.     if ($t) {
  20.     print;
  21.     if ($rm) {
  22.         s/[\r\n]//g;
  23.         unlink($_) || die("unlink($_)");
  24.     }
  25.     }
  26. }
  27. close(F);
  28.